<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="">
			<img id="id1" src="img/图片切换/1.jpg" >
		</div>
		<div id="">
			<button type="button" onclick="dobegin();">开始</button>
		</div>
	</body>
	<script type="text/javascript">
		function dobegin(){
		var num =2;
		var img = document.getElementById('id1');
		var aa= setInterval(function(){
			console.log(num);
			if (num >= 9 ) {
				clearInterval(aa);
			}
			img.src ='img/图片切换/'+num+'.jpg';
			num++;
		},100)
		}
	</script>
</html>

